const app = getApp()

Page({
  data: {
		obj:[]
	},
	picker(e){
		let classid = e.detail.value
		// console.log(classid);
		let {classifyId,classify } = this.data.obj[classid]
		// console.log(id);
		wx.navigateTo({
		  url: '../book/book?id=' + classifyId +'&title='+classify,

		})
	},
  onLoad(){
	let _this=this;
    wx.request({
      url: 'https://route.showapi.com/1700-1',
      method:'get',
      data:{'showapi_appid':1367085,
      'showapi_sign':'cb8507c33e4a43cfa34a954c91b91fd6',},
      header:{'Content-type':'application/json'},
      success(res){
          // console.log(res.data.showapi_res_body.storylist);
        _this.setData({obj:res.data.showapi_res_body.storylist})
		// console.log(_this.data.obj);
		
			// 修改navigationBarTitleText
			wx.setNavigationBarTitle({
				title:'儿童小故事'
			})
      },
      fail(err){
          console.log(err);
      }
    })
  }
})